#!/usr/bin/env python
# encoding: utf-8
"""
PlainPage.py

Created by Manabu Terada on 2009-09-26.
Copyright (c) 2009 CMScom. All rights reserved.
"""
from AccessControl import ClassSecurityInfo
from ComputedAttribute import ComputedAttribute
from zope import interface

from Products.Archetypes.atapi import *
from Products.CMFCore.utils import getToolByName

from Products.ATContentTypes.content.base import ATCTContent
from Products.ATContentTypes.content.schemata import finalizeATCTSchema
from Products.ATContentTypes.configuration import zconf
from Products.CMFCore.permissions import View, ModifyPortalContent

from c2.site.icos09 import icos09MessageFactory as _
from c2.site.icos09.content.interfaces import IPlainPage
from c2.site.icos09.config import *

schema = Schema((
    TextField(
        name='body',
        searchable=True,
        widget=TextAreaWidget(
            label='Body',
            label_msgid='label_body',
            i18n_domain='icos09',
        ),
    ),
    ),)
plainpage_schema = getattr(ATCTContent, 'schema', Schema(())).copy() + schema.copy()
# plainpage_schema['relatedItems'].widget.visible['edit'] = 'invisible'
finalizeATCTSchema(plainpage_schema)

class PlainPage(ATCTContent):
    """
    """
    security = ClassSecurityInfo()
    interface.implements(IPlainPage)
    schema = plainpage_schema
    
    meta_type = "PlainPage"
    _at_rename_after_creation = True
    
registerType(PlainPage, PROJECTNAME)


